package cc.comac.mom.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipRepairRepositorySparePartsService;
import cc.comac.mom.bean.EquipRepairRepository;
import cc.comac.mom.bean.EquipRepairRepositorySpareParts;
import cc.comac.mom.bean.EquipRepairRepositorySparePartsBean;
import cc.comac.mom.util.ResultBean;

@RestController
@RequestMapping(value ="/Equip/repair/repository/SpareParts")
public class EquipRepairRepositorySparePartsServiceController {
	
	@Autowired
	private EquipRepairRepositorySparePartsService equipRepairRepositorySparePartsService;
	
	@RequestMapping(value = "/save",method = RequestMethod.POST)

	public ResultBean save(@RequestBody EquipRepairRepositorySpareParts obj) {
		return equipRepairRepositorySparePartsService.save(obj);
	}
	
	@RequestMapping(value = "/delete",method = RequestMethod.POST)

	public ResultBean delete(@RequestBody EquipRepairRepositorySpareParts obj) {
		return equipRepairRepositorySparePartsService.delete(obj);
	}
	
	@RequestMapping(value = "/update",method = RequestMethod.POST)

	public ResultBean update(@RequestBody EquipRepairRepositorySpareParts obj) {
		return equipRepairRepositorySparePartsService.update(obj);
	}
	
	@RequestMapping(value = "/saveBatch",method = RequestMethod.POST)

	public ResultBean saveBatch(@RequestBody List<EquipRepairRepositorySpareParts> list) {
		return equipRepairRepositorySparePartsService.save(list);
	}

	@RequestMapping(value = "/updateBatch",method = RequestMethod.POST)
	public ResultBean updateBatch(@RequestBody List<EquipRepairRepositorySpareParts> list) {
		return equipRepairRepositorySparePartsService.update(list);
	}
	
	@RequestMapping(value = "/deleteBatch",method = RequestMethod.POST)
	public ResultBean deleteBatch(@RequestBody List<EquipRepairRepositorySpareParts> list) {
		return equipRepairRepositorySparePartsService.delete(list);
	}
	@RequestMapping(value = "/getById/{id}",method = RequestMethod.GET)
	public EquipRepairRepositorySpareParts getById(@PathVariable long id) {
		return equipRepairRepositorySparePartsService.getById(id);
	}
	
	@RequestMapping(value = "/selectByCondition",method = RequestMethod.POST)
	public ResultBean selectByCondition(@RequestBody EquipRepairRepository obj) {

		return equipRepairRepositorySparePartsService.selectByCondition(obj);
	}
	
	@RequestMapping(value = "/selectByFields",method = RequestMethod.POST)
	public ResultBean selectByFields(@RequestBody EquipRepairRepositorySparePartsBean obj) {
		return equipRepairRepositorySparePartsService.selectByFields(obj);
	}
}
